//
//  DeleteDateCell.m
//  Daybook
//
//  Created by dllo on 16/6/5.
//  Copyright © 2016年 zhangbin. All rights reserved.
//

#import "DeleteDateCell.h"
#import "Common.h"
@interface DeleteDateCell ()

@property (nonatomic, strong) UIImageView *picImageView;
@property (nonatomic, strong) UIView *lineView;
@end


@implementation DeleteDateCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}
- (void)createView {
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_nameLabel];
    
    self.detailLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_detailLabel];
    
    self.picImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_picImageView];
    
    self.lineView = [[UIView alloc] init];
    [self.contentView addSubview:_lineView];
    
    self.currentStateLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_currentStateLabel];
//    _currentStateLabel.backgroundColor = [UIColor darkGrayColor];
    _currentStateLabel.textAlignment = NSTextAlignmentRight;
    _currentStateLabel.textColor = [UIColor lightGrayColor];
    
}
- (void)layoutSubviews {
    [super layoutSubviews];
        _nameLabel.frame = CGRectMake(0, 0, MAIN_WIDTH / 4, MAIN_HEIGHT / 4 * 3 / 11);
        _nameLabel.textAlignment = NSTextAlignmentLeft;
        _nameLabel.center = CGPointMake(MAIN_WIDTH / 6, MAIN_HEIGHT / 4 * 3 / 11 / 2);
        //        NSLog(@"%f", self.contentView.frame.size.height);
        //        NSLog(@"%f", _titleLabel.frame.origin.x);
        //        NSLog(@"%f", _titleLabel.frame.size.height);
    
        _currentStateLabel.font = [UIFont systemFontOfSize:16];
       _currentStateLabel.frame = CGRectMake(MAIN_WIDTH - [CalculateFrameView setWidth:200], [CalculateFrameView setHeight:5], [CalculateFrameView setWidth:140], MAIN_HEIGHT / 4 * 3 / 11 / 4 * 3);
    
        _nameLabel.font = [UIFont systemFontOfSize:16];
        _detailLabel.frame = CGRectMake(0, 0, MAIN_WIDTH / 3, MAIN_HEIGHT / 4 * 3 / 11 / 4 * 3);
        _detailLabel.textAlignment = NSTextAlignmentRight;
        _detailLabel.center = CGPointMake(MAIN_WIDTH / 3 * 2, self.contentView.center.y);
        _detailLabel.textColor = [UIColor lightGrayColor];
        _picImageView.frame = CGRectMake(MAIN_WIDTH / 6 * 5, 0, MAIN_WIDTH / 15, MAIN_HEIGHT / 4 * 3 / 11 / 2 );
        [_picImageView setImage:[UIImage imageNamed:@"xiangqian.png"]];
        _picImageView.center = CGPointMake(MAIN_WIDTH / 12 * 11, self.contentView.center.y);
        
        _lineView.frame = CGRectMake(0, self.contentView.frame.size.height - 1, self.contentView.frame.size.width, 1);
        
        _lineView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
